package com.spring.service;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.spring.dao.UserDao;

@Service
@Transactional(propagation=Propagation.REQUIRED)
public class UserService {
	@Autowired
	private UserDao userDao;
	
	public void transMoney(String out,String in,int money) {
		userDao.outMoney(out, money);
		int i = 1/0;
		userDao.inMoney(in, money);
	}
}
